package com.java.test.system.registrationtemplate.entity;

import lombok.Data;
import org.springframework.jdbc.core.RowMapper;

import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * 模板实体
 *
 * @author lijie1
 * @date 2020/6/29 0029
 */
@Data
public class RegistrationTemplateEntity implements RowMapper<RegistrationTemplateEntity> {

    private Long id;//id
    private int type;//类型
    private String name;//名称
    private String remarks;//备注
    private String operation;//操作人
    private Date modifyTime;//修改时间
    private Date createTime;//创建时间
    private int status;//状态
    private String areaId;//地区id
    private String fieldId;//字段id
    private String trilateralId;//第三方id
    private String areaName;//地区名称
    private String fieldName;//字段名称
    private String trilateralName;//第三方名称
    private String typeName;//类型名称


    @Override
    public RegistrationTemplateEntity mapRow(ResultSet resultSet, int i) throws SQLException {
        RegistrationTemplateEntity info = new RegistrationTemplateEntity();
        info.setId(resultSet.getLong("id"));
        info.setType(resultSet.getInt("type"));
        info.setName(resultSet.getString("name"));
        info.setRemarks(resultSet.getString("remarks"));
        info.setOperation(resultSet.getString("operation"));
        info.setModifyTime(resultSet.getDate("modifyTime"));
        info.setCreateTime(resultSet.getDate("createTime"));
        info.setStatus(resultSet.getInt("status"));
        info.setAreaId(resultSet.getString("area_id"));
        info.setFieldId(resultSet.getString("field_id"));
        info.setTrilateralId(resultSet.getString("trilateral_id"));

        return info;
    }
}
